package recycle.common;

import lombok.Data;
@Data
public class Result {

    private Integer code;
    private String message;
    private Object data;

    private Result() {
    }


    public static Result  ok() {
        Result result = new Result();
        result.setCode(200);
        result.setMessage("ok");
        return result;
    }

    public static Result  ok(Object data) {
        Result result = new Result();
        result.setCode(200);
        result.setMessage("ok");
        result.setData(data);
        return result;
    }

    public static Result error(String message) {
        Result result = new Result();
        result.setCode(400);
        result.setMessage(message);
        return result;
    }
}
